package com.campus.user.controller;


import com.campus.common.result.Result;
import com.campus.common.teacher.job.entity.Teacher;
import com.campus.common.teacher.job.entity.dto.AddTeacherDTO;
import com.campus.common.teacher.service.ITeacherService;
import com.campus.common.user.entity.dto.InsertUserDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 * 教师信息表 前端控制器
 * </p>
 *
 * @author mwb
 * @since 2024-11-17
 */
@RestController
@RequestMapping("/teacher")
@Tag(name = "教师服务")
public class TeacherController {

    @Autowired
    private ITeacherService teacherService;

    @PostMapping("/addTeacher")
    @Operation(summary = "完善教师信息")
    public Result addTeacherFun(@RequestBody AddTeacherDTO addTeacherDTO){
        return teacherService.addTeacher(addTeacherDTO);
    }

    @PutMapping("/editTeacher")
    @Operation(summary = "编辑教师信息")
    public Result editTeacherFun(@RequestBody Teacher teacher){
        return teacherService.editTeacher(teacher);
    }

    @Operation(summary = "新增教师信息")
    @PostMapping("/insertTeacher")
    public Result insertTeacherFun(@RequestBody InsertUserDTO insertUserDTO){
        return teacherService.insertTeacher(insertUserDTO);
    }

}
